#ifndef SERVER_HPP
#define SERVER_HPP

#include <QObject>
#include <QString>
#include <QList>
#include <QFile>
#include <QtNetwork/QSslSocket>
#include <QtNetwork/QTcpServer>
#include <QtNetwork/QSslKey>

// TCP server with ssl socket
class Server : public QTcpServer
{
   // allow to use slots and signals
    Q_OBJECT

protected :
    QSslSocket *serverSocket;
    QString privateKey;
    QString localCertificate;
	
    virtual void display(QString);

public:
    Server();
    Server(quint16); // Port
    ~Server();

    void start(QHostAddress, quint16);

    // Method calls by the TCP server when a new connection is coming
    void incomingConnection(int);

public slots :
    void read(); // Calls when server is ready to read
    void disconnected();
};

#endif // SERVER_HPP
